package com.hulk.rpc.annotation;

import java.lang.annotation.*;

/**
 * @author xuxukang
 * @date 2019-04-17 22:35
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(value = {ElementType.METHOD, ElementType.TYPE})
@Documented
public @interface HulkService {

  String default_group = "default";
  String default_app = "app";
  //(1-10)
  int default_weight = 1;
  String default_version = "1.0.0";
  long default_timeout = 5 * 1000L;
  boolean ignore = false;

  /**
   * 是否对外暴露服务
   */
  boolean ignore() default ignore;

  /**
   * 服务版本
   */
  String version() default default_version;

  /**
   * 调用超时
   */
  long timeout() default default_timeout;

  /**
   * rest接口前缀
   * <code><br/><br/>
   * &#64;RPCService(rest = "/create", version = "1.2.1")<br/>
   * public CompletableFuture&lt;Boolean&gt; createUser(User user);
   * </code><br/><br/>
   * curl调用地址: curl -X POST http://host:port/group/app/user/create?v=1.2.1
   */
  String rest() default "";

}
